import request from '../../utils/request'
import { IloginAction } from '../actions/action'

// 登录
export const userLogin = ({ payload }: IloginAction) => {
  const res = request.post('/api/sys/login', payload)

  return res
}

// 获取用户信息
export const getUserInfo = async () => {
  const res = await request.post('/api/sys/profile')

  return res
}

// 获取用户信息
export const getUserDetailById = async (id: string) => {
  const res = await request.get(`/api/sys/user/${id}`)

  return res
}
